# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Angel Velasquez <angvp@archlinux.org> 
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: damir <damir@archlinux.org>
# Contributor: Daniel Bainton <dpb [at] backarrow.org>

pkgname=ncmpc
pkgver=0.49
pkgrel=1
pkgdesc="Fully featured MPD client which runs in a terminal"
arch=(loong64 x86_64)
url=https://www.musicpd.org/clients/ncmpc/
license=(GPL2)
depends=(
  gcc-libs
  glibc
  lirc
  pcre2
)
makedepends=(
  boost
  libmpdclient
  meson
  ncurses
  python-sphinx
)
optdepends=(
  'python-beautifulsoup4: for lyrics scripts'
  'python-requests: for lyrics scripts'
)
source=(https://www.musicpd.org/download/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz{,.sig})
sha512sums=('9913f08d90b229af59c8da0ac737445661dc69f0174f996dedbd0c9d9c4833004dbd9319f6bc08dc8b35a191ae167c090a3f31b43167e1918c5fad8f044a4c17'
            'SKIP')
b2sums=('c87c07bcf107e20224982a99fdedb09468ed510f7e6138e6e35386c636bdf62a3fd79e609670f7931966e3be09de668d1119ade950f2b8e4cd7c546d47a405be'
        'SKIP')
validpgpkeys=('0392335A78083894A4301C43236E8A58C6DB4512') # Max Kellermann <max@blarg.de>

build() {
  arch-meson -D lyrics_screen=true -D chat_screen=true build $pkgname-$pkgver
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends+=(
    libmpdclient libmpdclient.so
    ncurses libncursesw.so
  )

  meson install -C build --destdir "$pkgdir"
}
